<?php

namespace App\Biz;

use App\Models\Config;
use Exception;
use Illuminate\Database\Eloquent\Model;

class ConfigBiz extends BaseBiz
{

    protected Config $config;

    /**
     * @param Config $config
     * @throws Exception
     */
    public function __construct(Config $config)
    {
        $this->config = $config->firstOr(function () use ($config){
            return $config;
        });
    }

    /**
     * @return Model|Config|null
     */
    public function getConfig(): Model|Config|null
    {
        return $this->config;
    }
}
